/*
 * Created on Jun 1, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.scohen.juploadr.ui.thumbnail;

import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.widgets.Composite;
import org.scohen.juploadr.app.ImageAttributes;

/**
 * @author steve
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class ThumbnailFactory {

    public static Thumbnail newThumbnail(Composite parent, final ImageAttributes attrs, int style) {
        Thumbnail tn = new PhotoSetThumbnailDecorator(parent, attrs, new UploadStateThumbnailDecorator(parent,
                attrs, new TagsThumbnailDecorator(parent, attrs, new UploadThumbnail(parent, attrs, style))));

        tn.addKeyListener(new KeyAdapter() {
            public void keyPressed(KeyEvent event) {
                attrs.keyPressed(event);
            }
        });
        return tn;
    }
}